import { apiUrl } from '@/common/js/Base.js';
// apiUrl.rare = 'http://10.131.101.207:8083/2.0/';
export const familyTree = {
    /**登陆**/
    getHome(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyTree/getHome', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    insertFamilyTree(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyTree/insertFamilyTree', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //查询列表数据
    findOneById(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyTree/findOneById', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    updateById(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyTree/updateById', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //删除列表数据
    deleteOneById(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyTree/deleteOneById', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //保存或修改家系图
    saveOrUpdate(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyDiagram/saveOrUpdate', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //判断是不是首次绘制家系图
    familyDiagramFlag(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyDiagram/familyDiagramFlag', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取家系图数据
    findByFamilyTreeId(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyDiagram/findByFamilyTreeId', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //删除该家系图
    deleteOneDiagramById(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyDiagram/deleteOneById', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取癌症表单详情
    findOneFromCancer(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyCancer/findOne', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //添加或更新一个家族成员所患一种癌症的数据
    saveOrUpdateCancerForm(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyCancer/saveOrUpdate', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //删除一位家族成员所患一种癌症的信息
    deleteOneByIdFromCancer(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyCancer/deleteOneById', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取健康表单详情
    findOneFromHealth(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyBasic/findOne', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //添加或更新一位家族成员的健康基本信息
    saveOrUpdateHealth(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyBasic/saveOrUpdate', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //删除一位家族成员所患一种癌症的信息
    deleteOneByIdFromHealth(obj) {
        return $ajax.post(apiUrl.rare + 'family/familyBasic/deleteOne', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //罕见病或遗传性肿瘤 判断有没有家系图
    getNewfamilyTree(obj){
        return $ajax.get(apiUrl.rare + 'family/familyTree/getNewfamilyTree', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //遗传风险评估
    geneticRisk(obj){
        return $ajax.post(apiUrl.rare + 'family/familyDiagram/geneticRisk', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //保存遗传风险评估
    saveGeneTicRisk(obj){
        return $ajax.post(apiUrl.rare + 'family/familyGenetic/saveOrUpdate', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    }
}